﻿@{
    ViewBag.Title = "GetOpenID";
}
@using WXPackage
@using WXDba.Entity
<h2>GetOpenID</h2>
@{
    UserManage _user = new UserManage();
    List<string> strList = new List<string>();
    //_user.LoadOpenID_Remove((idList, count, curCount) =>
    //{
    //    this.Write("总数量：" + count);
    //    this.Write(",获取结果：" + string.Join(",", idList));
    //    this.WriteLiteral("<br />");
    //    strList = idList;
    //    //foreach (var item in idList)
    //    //{
    //    //    //加载用户基本信息
    //    //    WXUser user = _user.LoadInfo_Remove(item);
    //    //    this.WriteLiteral("<pre>");
    //    //    this.WriteLiteral(user.ToJsonString());
    //    //    this.WriteLiteral("</pre>");
    //    //    this.WriteLiteral("<br />");
    //    //}
    //});


    @*//批量获取用户信息
    List<WXUser> userList=  _user.LoadList_Remove(strList);
    foreach (var item in userList)
    {
        <p>
            昵称：@item.NickName
            <img src="@(item.HeadImgUrl.Substring(0,item.HeadImgUrl.Length-1))64" />
            <img src="@item.HeadImgUrl" />
        </p>
    }*@
    //修改用户备注
    //_user.UpdateRemark("oXCEct3-bDmFhpH1A48wUUAItH74", "张三丰");

    //同步用户OpenID到本地数据库
    int count= _user.SyncOpenID();
    @:总共获取OpenID@(count)个<br/>
    //同步用户基本信息到本地
    int count2 = _user.SyncUserInfo();
    @:同步基本信息@(count2)个<br />

}
